package com.example.demo_2301a.wed;

import java.sql.*;

/**
 * @author LR
 * @version 1.0
 * @date 2025/2/26
 * @description TODO
 */
public class JDBCUntl {
    public static Connection getConnection() throws  Exception {
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/bawei?useSSL=false&serverTimezone=UTC"
                , "root", "root");
        return conn;
    }
    public  static void Close(Connection conn, PreparedStatement pr, ResultSet rs) throws Exception {
        if (rs!=null){
            rs.close();
        }
        conn.close();
        pr.close();
    }
}
